<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CryptoAuthLib: atca_mbedtls_wrap.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CryptoAuthLib
   </div>
   <div id="projectbrief">Microchip CryptoAuthentication Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00599.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">atca_mbedtls_wrap.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Wrapper functions to replace cryptoauthlib software crypto functions with the mbedTLS equivalent.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;mbedtls/config.h&quot;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &quot;mbedtls/pk.h&quot;</code><br />
<code>#include &quot;mbedtls/ecp.h&quot;</code><br />
<code>#include &quot;mbedtls/x509_crt.h&quot;</code><br />
<code>#include &quot;<a class="el" href="a00359_source.html">cryptoauthlib.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="a00182_source.html">atcacert/atcacert_client.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="a00194_source.html">atcacert/atcacert_def.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aa7fa389b6ec8a6c33f594f8c3f5c76ef"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00599.html#aa7fa389b6ec8a6c33f594f8c3f5c76ef">mbedtls_calloc</a>&#160;&#160;&#160;calloc</td></tr>
<tr class="separator:aa7fa389b6ec8a6c33f594f8c3f5c76ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f80030b2d10f956f8ac00b57eebfbe8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00599.html#a4f80030b2d10f956f8ac00b57eebfbe8">mbedtls_free</a>&#160;&#160;&#160;free</td></tr>
<tr class="separator:a4f80030b2d10f956f8ac00b57eebfbe8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga72da31831a3647e287543634e3f78aca"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00996.html#ga72da31831a3647e287543634e3f78aca">atca_mbedtls_pk_init</a> (mbedtls_pk_context *pkey, const uint16_t slotid)</td></tr>
<tr class="memdesc:ga72da31831a3647e287543634e3f78aca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes an mbedtls pk context for use with EC operations.  <a href="a00996.html#ga72da31831a3647e287543634e3f78aca">More...</a><br /></td></tr>
<tr class="separator:ga72da31831a3647e287543634e3f78aca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ee0c99bd49ca5a196d7255b07d9375a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00599.html#a4ee0c99bd49ca5a196d7255b07d9375a">atca_mbedtls_cert_add</a> (mbedtls_x509_crt *cert, const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a> *cert_def)</td></tr>
<tr class="memdesc:a4ee0c99bd49ca5a196d7255b07d9375a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rebuild a certificate from an atcacert_def_t structure, and then add it to an mbedtls cert chain.  <a href="#a4ee0c99bd49ca5a196d7255b07d9375a">More...</a><br /></td></tr>
<tr class="separator:a4ee0c99bd49ca5a196d7255b07d9375a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Wrapper functions to replace cryptoauthlib software crypto functions with the mbedTLS equivalent. </p>
<dl class="section copyright"><dt>Copyright</dt><dd>(c) 2015-2019 Microchip Technology Inc. and its subsidiaries. </dd></dl>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="aa7fa389b6ec8a6c33f594f8c3f5c76ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa7fa389b6ec8a6c33f594f8c3f5c76ef">&#9670;&nbsp;</a></span>mbedtls_calloc</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define mbedtls_calloc&#160;&#160;&#160;calloc</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a4f80030b2d10f956f8ac00b57eebfbe8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f80030b2d10f956f8ac00b57eebfbe8">&#9670;&nbsp;</a></span>mbedtls_free</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define mbedtls_free&#160;&#160;&#160;free</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a4ee0c99bd49ca5a196d7255b07d9375a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ee0c99bd49ca5a196d7255b07d9375a">&#9670;&nbsp;</a></span>atca_mbedtls_cert_add()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int atca_mbedtls_cert_add </td>
          <td>(</td>
          <td class="paramtype">mbedtls_x509_crt *&#160;</td>
          <td class="paramname"><em>cert</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00990.html#gae9e78b17340263e97844ccaf72ca16ac">atcacert_def_t</a> *&#160;</td>
          <td class="paramname"><em>cert_def</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Rebuild a certificate from an atcacert_def_t structure, and then add it to an mbedtls cert chain. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">cert</td><td>mbedtls cert chain. Must have already been initialized </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cert_def</td><td>Certificate definition that will be rebuilt and added </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, otherwise an error code. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_c4875bffc6c901e8f9ea57d13c10be7a.html">mbedtls</a></li><li class="navelem"><a class="el" href="a00599.html">atca_mbedtls_wrap.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
